package com.ningxia.water.controller;

import com.ningxia.water.reuslt.Result;
import com.ningxia.water.reuslt.ResultResponse;
import com.ningxia.water.service.ITsMeterFlowService;
import com.ningxia.water.vo.out.DataDetailsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/datadetail")
@Api(tags = "采集数据明细")
public class DataDetailController {

    @Autowired
    private ITsMeterFlowService meterFlowService;

    @GetMapping("/getdatadetail")
    @ApiOperation("获取采集数据明细")
    public Result getDataDetail(@RequestParam(value = "meterId", required = false) String meterId,
                                @RequestParam(value = "wellName", required = false) String wellName,
                                @RequestParam(value = "applicantName", required = false) String applicantName){
        List<DataDetailsVo> list = meterFlowService.getDataDetails(meterId, wellName, applicantName);
        return ResultResponse.getSuccessResult(list);

    }
}
